//显示成功
const Success = (message,callback,noIcon)=>{	
	if(noIcon === true){
		uni.showToast({
			title:message,
			icon:'none',			
			success(){
				callback && (setTimeout(()=>{
					callback();
				},500));
			}
		})
		return false;
	}
	uni.showToast({
		title:message,
		icon:"success",
		success(){
			callback && (setTimeout(()=>{
				callback();
			},500));
		}
	})
}
//显示失败
const Fail=(message,callback)=>{
	uni.showModal({
		title:"提示",
		content:message,		
		showCancel:false,
		success(res){
			//console.log('yes');
			callback && callback(res);
		}
	})
}
//显示选择
const Confirm=(msg,cancelText,confirmText,callback)=>{
	uni.showModal({
		title:"提示",
		content:msg,
		showCancel:true,
		cancelText:cancelText,
		confirmText:confirmText,
		success(res){	
			console.log(res)
			callback && callback(res);			
		}
	})
}

module.exports = {    
	Success:Success,
	Fail:Fail,
	Confirm:Confirm,
}